from redis import StrictRedis

class Config():
    # 调试信息
    DEBUG = True
    # 设置密钥
    SECRET_KEY = 'Rg84ukHcBGXbkapNS9xCJWuvKXQ7piTDNKvzfBJDKV3eNL6lrvvTfsKFk2hB'

    # 配置mysql的连接
    SQLALCHEMY_DATABASE_URI = 'mysql://root:mysql@localhost/info33'
    SQLALCHEMY_TRACK_MODIFICATIONS = False

    # 设置session信息存储在redis中
    SESSION_TYPE = 'redis'
    SESSION_REDIS = StrictRedis(host='127.0.0.1', port=6379)
    # SESSION信息签名
    SESSION_USE_SIGNER = True
    # SESSION有效期设置为 一天
    PERMANENT_SESSION_LIFETIME = 86400

# 定义开发模式下的配置
class DevelopmentConfig(Config):
    DEBUG = True

# 定义生产模式下的配置
class ProductionConfig(Config):
    DEBUG = False

config_dict = {
    'development':DevelopmentConfig,
    'production':ProductionConfig
}